package com.panshi.vo;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageModel<T> implements Serializable {

    //默认每页展示的条数
    public static final Integer PAGE_SIZE = 5;

    //状态
    private Integer code;

    //信息
    private String msg;

    //总条数
    private Integer count;

    //当前页
    private Integer currentPage;

    //当前页条数
    private Integer pageSize;

    //查询的数据
    private List<T> list;

    public void init(){
        if(this.currentPage <= 0) {
            currentPage = 1;
        }
        if(this.pageSize <=0) {
            this.pageSize = PAGE_SIZE;
        }
    }

}
